use std::any::Any;
use std::collections::HashMap;
use log::info;

#[test]
fn ttt_test() {
    let mut map : HashMap<&'static str, Box<dyn Any>> = HashMap::new();
    map.insert("t1", Box::new("1111"));
    map.insert("t2", Box::new(222));
    map.insert("t3", Box::new("333333".to_string()));

    if let Some(int_val) = map.get("t1").and_then(|b| b.downcast_ref::<&str>()) {
        info!("str: {}", int_val);
    }

    if let Some(int_val) = map.get("t2").and_then(|b| b.downcast_ref::<i32>()) {
        info!("int: {}", int_val);
    }

    if let Some(int_val) = map.get("t3").and_then(|b| b.downcast_ref::<String>()) {
        info!("String: {}", int_val);
    }

}